Data collection

## Using libcurl 8.3.0 with Schannel
## `geom_smooth()` using formula = 'y ~ x'

Location effects

Will run an ANOVA on the residuals with location and species as fixed effects. This will show me if morphology depends on the species, the location, and if the location and species interact to determine morphology. CANNOT DO WITH COUNT DATA–may have to run a glmer with zero-tuncated negative binomial/quasi-poisson distribution instead (think this will tell me if species, location, and interaction affect the trait…). Will only work with the residuals, because comparing the means of the residuals indicates differences in variation. Would I not just use Levene’s and MWU again but include spp and zone/basin/watershed?

Leaving the anovas for count data in rn until I figure out what to do.

I will first run this using the zones as the location factor. Zones (1-4) represent the latitude range with equivalent sample sizes in each, since the collections were not equally representative of all latitudes, and I wanted to avoid a sampling bias when randomly selecting samples. Zone 1 corresponds to the southern most latitude range, and zone 4 corresponds to the northern most latitude range.

I will then run the same analysis using basin as the location factor. Since fish are physically isolated to the river basins they occupy, the genetic variation is also limited to that basin. Thus it is possible for fish within the same basin to be more similar due to genetic/physical constraints. (will also do with watershed just to see).

Lastly I will run ANOVAs with both zones and basins but with standardized residuals. This would allow me to compare overall variation across traits (at least those that are depended on body size) rather than just one trait at a time. Not 100% sure if this is useful (or correct to do), but thought it would be interesting.

ANOVAs

Amazon

Zones
library(ggplot2)

lat3 <- raw2[raw2$SPP == "p.latipinna", ]

form3 <- raw2[raw2$SPP == "p.latipinna", ]

A.D <- aov(abs.res.D ~ QUARTILE, data=form3)
summary(A.D)
##              Df Sum Sq Mean Sq F value  Pr(>F)   
## QUARTILE      3  2.306  0.7685   4.292 0.00635 **
## Residuals   130 23.277  0.1791                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.D)) +
  geom_boxplot()

A.P1 <- aov(abs.res.P1 ~ QUARTILE, data=form3)
summary(A.P1)
##              Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE      3  0.159 0.05296   0.444  0.722
## Residuals   130 15.511 0.11932
A.P1.R <- aov(abs.res.P1.R ~ QUARTILE, data=form3)
summary(A.P1.R)
##              Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE      3  0.065 0.02172   0.166  0.919
## Residuals   130 16.987 0.13067
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.P1.R)) +
  geom_boxplot()

A.LLSC <- aov(abs.res.LLSC ~ QUARTILE, data=form3)
summary(A.LLSC)
##              Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE      3   1.31  0.4354   1.209  0.309
## Residuals   130  46.80  0.3600
A.SBLL <- aov(abs.res.SBLL ~ QUARTILE, data=form3)
summary(A.SBLL)
##              Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE      3  0.436  0.1454   1.142  0.335
## Residuals   130 16.546  0.1273
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.SBLL)) +
  geom_boxplot()

A.BD <- aov(abs.res.BD ~ QUARTILE, data=form3)
summary(A.BD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## QUARTILE      3 0.00594 0.001981   1.519  0.213
## Residuals   130 0.16955 0.001304
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.BD)) +
  geom_boxplot()

A.CPD <- aov(abs.res.CPD ~ QUARTILE, data=form3)
summary(A.CPD)
##              Df  Sum Sq  Mean Sq F value  Pr(>F)    
## QUARTILE      3 0.01249 0.004163   6.832 0.00026 ***
## Residuals   130 0.07922 0.000609                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.CPD)) +
  geom_boxplot()

A.CPL <- aov(abs.res.CPL ~ QUARTILE, data=form3)
summary(A.CPL)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## QUARTILE      3 0.02074 0.006912   9.448 1.08e-05 ***
## Residuals   130 0.09511 0.000732                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.CPL)) +
  geom_boxplot()

A.PreDL <- aov(abs.res.PreDL ~ QUARTILE, data=form3)
summary(A.PreDL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## QUARTILE      3 0.00209 0.0006977   1.606  0.191
## Residuals   130 0.05646 0.0004343
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.PreDL)) +
  geom_boxplot()

A.DbL <- aov(abs.res.DbL ~ QUARTILE, data=form3)
summary(A.DbL)
##              Df  Sum Sq  Mean Sq F value Pr(>F)  
## QUARTILE      3 0.01219 0.004063   2.276 0.0828 .
## Residuals   130 0.23204 0.001785                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.DbL)) +
  geom_boxplot()

A.HL <- aov(abs.res.HL ~ QUARTILE, data=form3)
summary(A.HL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## QUARTILE      3 0.00344 0.0011466   1.324  0.269
## Residuals   130 0.11260 0.0008661
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.HL)) +
  geom_boxplot()

A.HD <- aov(abs.res.HD ~ QUARTILE, data=form3)
summary(A.HD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## QUARTILE      3 0.00672 0.002239    2.04  0.111
## Residuals   130 0.14269 0.001098
A.HW <- aov(abs.res.HW ~ QUARTILE, data=form3)
summary(A.HW)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## QUARTILE      3 0.01136 0.003788   7.212 0.000163 ***
## Residuals   130 0.06827 0.000525                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.HW)) +
  geom_boxplot()

A.SnL <- aov(abs.res.SnL ~ QUARTILE, data=form3)
summary(A.SnL)
##              Df  Sum Sq   Mean Sq F value  Pr(>F)   
## QUARTILE      3 0.00766 0.0025545   5.052 0.00242 **
## Residuals   130 0.06573 0.0005056                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A.OL <- aov(abs.res.OL ~ QUARTILE, data=form3)
summary(A.OL)
##              Df   Sum Sq   Mean Sq F value Pr(>F)
## QUARTILE      3 2.17e-32 7.242e-33   1.538  0.208
## Residuals   130 6.12e-31 4.708e-33
ggplot(form3, aes(x=factor(QUARTILE), y=abs.res.OL)) +
  geom_boxplot()

Basins
A1.D <- aov(abs.res.D ~ BASIN, data=form3)
summary(A1.D)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## BASIN         5  2.789  0.5579   3.133 0.0106 *
## Residuals   128 22.793  0.1781                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(BASIN), y=abs.res.D)) +
  geom_boxplot()

A1.P1 <- aov(abs.res.P1 ~ BASIN, data=form3)
summary(A1.P1)
##              Df Sum Sq Mean Sq F value Pr(>F)
## BASIN         5  0.945  0.1891   1.643  0.153
## Residuals   128 14.725  0.1150
A1.P1.R <- aov(abs.res.P1.R ~ BASIN, data=form3)
summary(A1.P1.R)
##              Df Sum Sq Mean Sq F value Pr(>F)
## BASIN         5  0.159 0.03187   0.241  0.943
## Residuals   128 16.893 0.13197
ggplot(form3, aes(x=factor(BASIN), y=abs.res.P1.R)) +
  geom_boxplot()

A1.LLSC <- aov(abs.res.LLSC ~ BASIN, data=form3)
summary(A1.LLSC)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## BASIN         5   4.54  0.9080   2.668  0.025 *
## Residuals   128  43.57  0.3404                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(BASIN), y=abs.res.LLSC)) +
  geom_boxplot()

A1.SBLL <- aov(abs.res.SBLL ~ BASIN, data=form3)
summary(A1.SBLL)
##              Df Sum Sq Mean Sq F value Pr(>F)
## BASIN         5  0.755  0.1510   1.191  0.317
## Residuals   128 16.228  0.1268
ggplot(form3, aes(x=factor(BASIN), y=abs.res.SBLL)) +
  geom_boxplot()

A1.BD <- aov(abs.res.BD ~ BASIN, data=form3)
summary(A1.BD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## BASIN         5 0.00786 0.001571     1.2  0.313
## Residuals   128 0.16764 0.001310
ggplot(form3, aes(x=factor(BASIN), y=abs.res.BD)) +
  geom_boxplot()

A1.CPD <- aov(abs.res.CPD ~ BASIN, data=form3)
summary(A1.CPD)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## BASIN         5 0.01713 0.003425   5.879 6.34e-05 ***
## Residuals   128 0.07458 0.000583                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(BASIN), y=abs.res.CPD)) +
  geom_boxplot()

A1.CPL <- aov(abs.res.CPL ~ BASIN, data=form3)
summary(A1.CPL)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## BASIN         5 0.02013 0.004025   5.383 0.000159 ***
## Residuals   128 0.09572 0.000748                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A1.PreDL <- aov(abs.res.PreDL ~ BASIN, data=form3)
summary(A1.PreDL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)  
## BASIN         5 0.00492 0.0009846    2.35 0.0445 *
## Residuals   128 0.05363 0.0004190                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(BASIN), y=abs.res.PreDL)) +
  geom_boxplot()

A1.DbL <- aov(abs.res.DbL ~ BASIN, data=form3)
summary(A1.DbL)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## BASIN         5 0.00996 0.001992   1.088   0.37
## Residuals   128 0.23428 0.001830
ggplot(form3, aes(x=factor(BASIN), y=abs.res.DbL)) +
  geom_boxplot()

A1.HL <- aov(abs.res.HL ~ BASIN, data=form3)
summary(A1.HL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## BASIN         5 0.00766 0.0015321   1.809  0.115
## Residuals   128 0.10838 0.0008467
ggplot(form3, aes(x=factor(BASIN), y=abs.res.HL)) +
  geom_boxplot()

A1.HD <- aov(abs.res.HD ~ BASIN, data=form3)
summary(A1.HD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## BASIN         5 0.00684 0.001367   1.228    0.3
## Residuals   128 0.14257 0.001114
ggplot(form3, aes(x=factor(BASIN), y=abs.res.HD)) +
  geom_boxplot()

A1.HW <- aov(abs.res.HW ~ BASIN, data=form3)
summary(A1.HW)
##              Df  Sum Sq   Mean Sq F value   Pr(>F)    
## BASIN         5 0.01460 0.0029194   5.746 8.11e-05 ***
## Residuals   128 0.06504 0.0005081                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(BASIN), y=abs.res.HW)) +
  geom_boxplot()

A1.SnL <- aov(abs.res.SnL ~ BASIN, data=form3)
summary(A1.SnL)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## BASIN         5 0.01931 0.003861   9.138 1.87e-07 ***
## Residuals   128 0.05409 0.000423                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A1.OL <- aov(abs.res.OL ~ BASIN, data=form3)
summary(A1.OL)
##              Df    Sum Sq   Mean Sq F value Pr(>F)
## BASIN         5 1.240e-32 2.479e-33   0.511  0.768
## Residuals   128 6.214e-31 4.854e-33
ggplot(form3, aes(x=factor(BASIN), y=abs.res.OL)) +
  geom_boxplot()

Watersheds
A2.D <- aov(abs.res.D ~ WATERSHED, data=form3)
summary(A2.D)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## WATERSHED    11  3.847  0.3497   1.963 0.0378 *
## Residuals   122 21.736  0.1782                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.D)) +
  geom_boxplot()

A2.P1 <- aov(abs.res.P1 ~ WATERSHED, data=form3)
summary(A2.P1)
##              Df Sum Sq Mean Sq F value Pr(>F)
## WATERSHED    11  1.302  0.1184   1.005  0.446
## Residuals   122 14.368  0.1178
A2.P1.R <- aov(abs.res.P1.R ~ WATERSHED, data=form3)
summary(A2.P1.R)
##              Df Sum Sq Mean Sq F value Pr(>F)
## WATERSHED    11   0.34 0.03093   0.226  0.995
## Residuals   122  16.71 0.13698
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.P1.R)) +
  geom_boxplot()

A2.LLSC <- aov(abs.res.LLSC ~ WATERSHED, data=form3)
summary(A2.LLSC)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## WATERSHED    11   8.16  0.7422   2.267  0.015 *
## Residuals   122  39.94  0.3274                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.LLSC)) +
  geom_boxplot()

A2.SBLL <- aov(abs.res.SBLL ~ WATERSHED, data=form3)
summary(A2.SBLL)
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## WATERSHED    11  5.086  0.4623   4.741 4.93e-06 ***
## Residuals   122 11.897  0.0975                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.SBLL)) +
  geom_boxplot()

A2.BD <- aov(abs.res.BD ~ WATERSHED, data=form3)
summary(A2.BD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## WATERSHED    11 0.01278 0.001162   0.871  0.571
## Residuals   122 0.16271 0.001334
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.BD)) +
  geom_boxplot()

A2.CPD <- aov(abs.res.CPD ~ WATERSHED, data=form3)
summary(A2.CPD)
##              Df  Sum Sq   Mean Sq F value  Pr(>F)   
## WATERSHED    11 0.01833 0.0016662    2.77 0.00304 **
## Residuals   122 0.07338 0.0006015                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.CPD)) +
  geom_boxplot()

A2.CPL <- aov(abs.res.CPL ~ WATERSHED, data=form3)
summary(A2.CPL)
##              Df  Sum Sq   Mean Sq F value   Pr(>F)    
## WATERSHED    11 0.03237 0.0029429   4.301 2.05e-05 ***
## Residuals   122 0.08347 0.0006842                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A2.PreDL <- aov(abs.res.PreDL ~ WATERSHED, data=form3)
summary(A2.PreDL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## WATERSHED    11 0.00568 0.0005163   1.191    0.3
## Residuals   122 0.05288 0.0004334
A2.DbL <- aov(abs.res.DbL ~ WATERSHED, data=form3)
summary(A2.DbL)
##              Df  Sum Sq  Mean Sq F value Pr(>F)  
## WATERSHED    11 0.04272 0.003883   2.351 0.0115 *
## Residuals   122 0.20152 0.001652                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.DbL)) +
  geom_boxplot()

A2.HL <- aov(abs.res.HL ~ WATERSHED, data=form3)
summary(A2.HL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## WATERSHED    11 0.01169 0.0010627   1.243  0.267
## Residuals   122 0.10435 0.0008553
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.HL)) +
  geom_boxplot()

A2.HD <- aov(abs.res.HD ~ WATERSHED, data=form3)
summary(A2.HD)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## WATERSHED    11 0.01036 0.0009418   0.826  0.614
## Residuals   122 0.13905 0.0011397
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.HD)) +
  geom_boxplot()

A2.HW <- aov(abs.res.HW ~ WATERSHED, data=form3)
summary(A2.HW)
##              Df  Sum Sq   Mean Sq F value  Pr(>F)   
## WATERSHED    11 0.01704 0.0015488   3.018 0.00136 **
## Residuals   122 0.06260 0.0005131                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.HW)) +
  geom_boxplot()

A2.SnL <- aov(abs.res.SnL ~ WATERSHED, data=form3)
summary(A2.SnL)
##              Df  Sum Sq   Mean Sq F value   Pr(>F)    
## WATERSHED    11 0.02208 0.0020073   4.772 4.46e-06 ***
## Residuals   122 0.05131 0.0004206                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A2.OL <- aov(abs.res.OL ~ WATERSHED, data=form3)
summary(A2.OL)
##              Df    Sum Sq   Mean Sq F value Pr(>F)
## WATERSHED    11 2.610e-32 2.372e-33   0.476  0.915
## Residuals   122 6.077e-31 4.981e-33
ggplot(form3, aes(x=factor(WATERSHED), y=abs.res.OL)) +
  geom_boxplot()

Sailfin

Zones
library(ggplot2)

A.D <- aov(abs.res.D ~ QUARTILE, data=lat3)
summary(A.D)
##              Df Sum Sq Mean Sq F value  Pr(>F)   
## QUARTILE      3  2.306  0.7685   4.292 0.00635 **
## Residuals   130 23.277  0.1791                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.D)) +
  geom_boxplot()

A.P1 <- aov(abs.res.P1 ~ QUARTILE, data=lat3)
summary(A.P1)
##              Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE      3  0.159 0.05296   0.444  0.722
## Residuals   130 15.511 0.11932
A.P1.R <- aov(abs.res.P1.R ~ QUARTILE, data=lat3)
summary(A.P1.R)
##              Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE      3  0.065 0.02172   0.166  0.919
## Residuals   130 16.987 0.13067
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.P1.R)) +
  geom_boxplot()

A.LLSC <- aov(abs.res.LLSC ~ QUARTILE, data=lat3)
summary(A.LLSC)
##              Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE      3   1.31  0.4354   1.209  0.309
## Residuals   130  46.80  0.3600
A.SBLL <- aov(abs.res.SBLL ~ QUARTILE, data=lat3)
summary(A.SBLL)
##              Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE      3  0.436  0.1454   1.142  0.335
## Residuals   130 16.546  0.1273
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.SBLL)) +
  geom_boxplot()

A.BD <- aov(abs.res.BD ~ QUARTILE, data=lat3)
summary(A.BD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## QUARTILE      3 0.00594 0.001981   1.519  0.213
## Residuals   130 0.16955 0.001304
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.BD)) +
  geom_boxplot()

A.CPD <- aov(abs.res.CPD ~ QUARTILE, data=lat3)
summary(A.CPD)
##              Df  Sum Sq  Mean Sq F value  Pr(>F)    
## QUARTILE      3 0.01249 0.004163   6.832 0.00026 ***
## Residuals   130 0.07922 0.000609                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.CPD)) +
  geom_boxplot()

A.CPL <- aov(abs.res.CPL ~ QUARTILE, data=lat3)
summary(A.CPL)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## QUARTILE      3 0.02074 0.006912   9.448 1.08e-05 ***
## Residuals   130 0.09511 0.000732                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.CPL)) +
  geom_boxplot()

A.PreDL <- aov(abs.res.PreDL ~ QUARTILE, data=lat3)
summary(A.PreDL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## QUARTILE      3 0.00209 0.0006977   1.606  0.191
## Residuals   130 0.05646 0.0004343
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.PreDL)) +
  geom_boxplot()

A.DbL <- aov(abs.res.DbL ~ QUARTILE, data=lat3)
summary(A.DbL)
##              Df  Sum Sq  Mean Sq F value Pr(>F)  
## QUARTILE      3 0.01219 0.004063   2.276 0.0828 .
## Residuals   130 0.23204 0.001785                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.DbL)) +
  geom_boxplot()

A.HL <- aov(abs.res.HL ~ QUARTILE, data=lat3)
summary(A.HL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## QUARTILE      3 0.00344 0.0011466   1.324  0.269
## Residuals   130 0.11260 0.0008661
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.HL)) +
  geom_boxplot()

A.HD <- aov(abs.res.HD ~ QUARTILE, data=lat3)
summary(A.HD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## QUARTILE      3 0.00672 0.002239    2.04  0.111
## Residuals   130 0.14269 0.001098
A.HW <- aov(abs.res.HW ~ QUARTILE, data=lat3)
summary(A.HW)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## QUARTILE      3 0.01136 0.003788   7.212 0.000163 ***
## Residuals   130 0.06827 0.000525                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.HW)) +
  geom_boxplot()

A.SnL <- aov(abs.res.SnL ~ QUARTILE, data=lat3)
summary(A.SnL)
##              Df  Sum Sq   Mean Sq F value  Pr(>F)   
## QUARTILE      3 0.00766 0.0025545   5.052 0.00242 **
## Residuals   130 0.06573 0.0005056                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A.OL <- aov(abs.res.OL ~ QUARTILE, data=lat3)
summary(A.OL)
##              Df   Sum Sq   Mean Sq F value Pr(>F)
## QUARTILE      3 2.17e-32 7.242e-33   1.538  0.208
## Residuals   130 6.12e-31 4.708e-33
ggplot(lat3, aes(x=factor(QUARTILE), y=abs.res.OL)) +
  geom_boxplot()

Basins
A1.D <- aov(abs.res.D ~ BASIN, data=lat3)
summary(A1.D)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## BASIN         5  2.789  0.5579   3.133 0.0106 *
## Residuals   128 22.793  0.1781                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.D)) +
  geom_boxplot()

A1.P1 <- aov(abs.res.P1 ~ BASIN, data=lat3)
summary(A1.P1)
##              Df Sum Sq Mean Sq F value Pr(>F)
## BASIN         5  0.945  0.1891   1.643  0.153
## Residuals   128 14.725  0.1150
A1.P1.R <- aov(abs.res.P1.R ~ BASIN, data=lat3)
summary(A1.P1.R)
##              Df Sum Sq Mean Sq F value Pr(>F)
## BASIN         5  0.159 0.03187   0.241  0.943
## Residuals   128 16.893 0.13197
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.P1.R)) +
  geom_boxplot()

A1.LLSC <- aov(abs.res.LLSC ~ BASIN, data=lat3)
summary(A1.LLSC)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## BASIN         5   4.54  0.9080   2.668  0.025 *
## Residuals   128  43.57  0.3404                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.LLSC)) +
  geom_boxplot()

A1.SBLL <- aov(abs.res.SBLL ~ BASIN, data=lat3)
summary(A1.SBLL)
##              Df Sum Sq Mean Sq F value Pr(>F)
## BASIN         5  0.755  0.1510   1.191  0.317
## Residuals   128 16.228  0.1268
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.SBLL)) +
  geom_boxplot()

A1.BD <- aov(abs.res.BD ~ BASIN, data=lat3)
summary(A1.BD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## BASIN         5 0.00786 0.001571     1.2  0.313
## Residuals   128 0.16764 0.001310
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.BD)) +
  geom_boxplot()

A1.CPD <- aov(abs.res.CPD ~ BASIN, data=lat3)
summary(A1.CPD)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## BASIN         5 0.01713 0.003425   5.879 6.34e-05 ***
## Residuals   128 0.07458 0.000583                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.CPD)) +
  geom_boxplot()

A1.CPL <- aov(abs.res.CPL ~ BASIN, data=lat3)
summary(A1.CPL)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## BASIN         5 0.02013 0.004025   5.383 0.000159 ***
## Residuals   128 0.09572 0.000748                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A1.PreDL <- aov(abs.res.PreDL ~ BASIN, data=lat3)
summary(A1.PreDL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)  
## BASIN         5 0.00492 0.0009846    2.35 0.0445 *
## Residuals   128 0.05363 0.0004190                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.PreDL)) +
  geom_boxplot()

A1.DbL <- aov(abs.res.DbL ~ BASIN, data=lat3)
summary(A1.DbL)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## BASIN         5 0.00996 0.001992   1.088   0.37
## Residuals   128 0.23428 0.001830
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.DbL)) +
  geom_boxplot()

A1.HL <- aov(abs.res.HL ~ BASIN, data=lat3)
summary(A1.HL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## BASIN         5 0.00766 0.0015321   1.809  0.115
## Residuals   128 0.10838 0.0008467
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.HL)) +
  geom_boxplot()

A1.HD <- aov(abs.res.HD ~ BASIN, data=lat3)
summary(A1.HD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## BASIN         5 0.00684 0.001367   1.228    0.3
## Residuals   128 0.14257 0.001114
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.HD)) +
  geom_boxplot()

A1.HW <- aov(abs.res.HW ~ BASIN, data=lat3)
summary(A1.HW)
##              Df  Sum Sq   Mean Sq F value   Pr(>F)    
## BASIN         5 0.01460 0.0029194   5.746 8.11e-05 ***
## Residuals   128 0.06504 0.0005081                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.HW)) +
  geom_boxplot()

A1.SnL <- aov(abs.res.SnL ~ BASIN, data=lat3)
summary(A1.SnL)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## BASIN         5 0.01931 0.003861   9.138 1.87e-07 ***
## Residuals   128 0.05409 0.000423                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A1.OL <- aov(abs.res.OL ~ BASIN, data=lat3)
summary(A1.OL)
##              Df    Sum Sq   Mean Sq F value Pr(>F)
## BASIN         5 1.240e-32 2.479e-33   0.511  0.768
## Residuals   128 6.214e-31 4.854e-33
ggplot(lat3, aes(x=factor(BASIN), y=abs.res.OL)) +
  geom_boxplot()

Watersheds
A2.D <- aov(abs.res.D ~ WATERSHED, data=lat3)
summary(A2.D)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## WATERSHED    11  3.847  0.3497   1.963 0.0378 *
## Residuals   122 21.736  0.1782                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.D)) +
  geom_boxplot()

A2.P1 <- aov(abs.res.P1 ~ WATERSHED, data=lat3)
summary(A2.P1)
##              Df Sum Sq Mean Sq F value Pr(>F)
## WATERSHED    11  1.302  0.1184   1.005  0.446
## Residuals   122 14.368  0.1178
A2.P1.R <- aov(abs.res.P1.R ~ WATERSHED, data=lat3)
summary(A2.P1.R)
##              Df Sum Sq Mean Sq F value Pr(>F)
## WATERSHED    11   0.34 0.03093   0.226  0.995
## Residuals   122  16.71 0.13698
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.P1.R)) +
  geom_boxplot()

A2.LLSC <- aov(abs.res.LLSC ~ WATERSHED, data=lat3)
summary(A2.LLSC)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## WATERSHED    11   8.16  0.7422   2.267  0.015 *
## Residuals   122  39.94  0.3274                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.LLSC)) +
  geom_boxplot()

A2.SBLL <- aov(abs.res.SBLL ~ WATERSHED, data=lat3)
summary(A2.SBLL)
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## WATERSHED    11  5.086  0.4623   4.741 4.93e-06 ***
## Residuals   122 11.897  0.0975                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.SBLL)) +
  geom_boxplot()

A2.BD <- aov(abs.res.BD ~ WATERSHED, data=lat3)
summary(A2.BD)
##              Df  Sum Sq  Mean Sq F value Pr(>F)
## WATERSHED    11 0.01278 0.001162   0.871  0.571
## Residuals   122 0.16271 0.001334
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.BD)) +
  geom_boxplot()

A2.CPD <- aov(abs.res.CPD ~ WATERSHED, data=lat3)
summary(A2.CPD)
##              Df  Sum Sq   Mean Sq F value  Pr(>F)   
## WATERSHED    11 0.01833 0.0016662    2.77 0.00304 **
## Residuals   122 0.07338 0.0006015                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.CPD)) +
  geom_boxplot()

A2.CPL <- aov(abs.res.CPL ~ WATERSHED, data=lat3)
summary(A2.CPL)
##              Df  Sum Sq   Mean Sq F value   Pr(>F)    
## WATERSHED    11 0.03237 0.0029429   4.301 2.05e-05 ***
## Residuals   122 0.08347 0.0006842                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A2.PreDL <- aov(abs.res.PreDL ~ WATERSHED, data=lat3)
summary(A2.PreDL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## WATERSHED    11 0.00568 0.0005163   1.191    0.3
## Residuals   122 0.05288 0.0004334
A2.DbL <- aov(abs.res.DbL ~ WATERSHED, data=lat3)
summary(A2.DbL)
##              Df  Sum Sq  Mean Sq F value Pr(>F)  
## WATERSHED    11 0.04272 0.003883   2.351 0.0115 *
## Residuals   122 0.20152 0.001652                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.DbL)) +
  geom_boxplot()

A2.HL <- aov(abs.res.HL ~ WATERSHED, data=lat3)
summary(A2.HL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## WATERSHED    11 0.01169 0.0010627   1.243  0.267
## Residuals   122 0.10435 0.0008553
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.HL)) +
  geom_boxplot()

A2.HD <- aov(abs.res.HD ~ WATERSHED, data=lat3)
summary(A2.HD)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## WATERSHED    11 0.01036 0.0009418   0.826  0.614
## Residuals   122 0.13905 0.0011397
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.HD)) +
  geom_boxplot()

A2.HW <- aov(abs.res.HW ~ WATERSHED, data=lat3)
summary(A2.HW)
##              Df  Sum Sq   Mean Sq F value  Pr(>F)   
## WATERSHED    11 0.01704 0.0015488   3.018 0.00136 **
## Residuals   122 0.06260 0.0005131                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.HW)) +
  geom_boxplot()

A2.SnL <- aov(abs.res.SnL ~ WATERSHED, data=lat3)
summary(A2.SnL)
##              Df  Sum Sq   Mean Sq F value   Pr(>F)    
## WATERSHED    11 0.02208 0.0020073   4.772 4.46e-06 ***
## Residuals   122 0.05131 0.0004206                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A2.OL <- aov(abs.res.OL ~ WATERSHED, data=lat3)
summary(A2.OL)
##              Df    Sum Sq   Mean Sq F value Pr(>F)
## WATERSHED    11 2.610e-32 2.372e-33   0.476  0.915
## Residuals   122 6.077e-31 4.981e-33
ggplot(lat3, aes(x=factor(WATERSHED), y=abs.res.OL)) +
  geom_boxplot()

Both

Zones
library(ggplot2)

A.D <- aov(abs.res.D ~ SPP*QUARTILE, data=raw3)
summary(A.D)
##               Df Sum Sq Mean Sq F value  Pr(>F)    
## SPP            1   0.06  0.0635   0.408 0.52344    
## QUARTILE       3   0.45  0.1510   0.970 0.40715    
## SPP:QUARTILE   3   3.22  1.0719   6.888 0.00017 ***
## Residuals    292  45.44  0.1556                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.D, fill=SPP)) +
  geom_boxplot()

A.P1 <- aov(abs.res.P1 ~ SPP*QUARTILE, data=raw3)
summary(A.P1)
##               Df Sum Sq Mean Sq F value Pr(>F)
## SPP            1   0.29  0.2878   1.554  0.214
## QUARTILE       3   1.10  0.3663   1.977  0.117
## SPP:QUARTILE   3   0.73  0.2427   1.310  0.271
## Residuals    292  54.10  0.1853
A.P1.R <- aov(abs.res.P1.R ~ SPP*QUARTILE, data=raw3)
summary(A.P1.R)
##               Df Sum Sq Mean Sq F value   Pr(>F)    
## SPP            1   1.80  1.7983  11.423 0.000824 ***
## QUARTILE       3   0.13  0.0434   0.276 0.842918    
## SPP:QUARTILE   3   0.06  0.0189   0.120 0.948162    
## Residuals    292  45.97  0.1574                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.P1.R, fill=SPP)) +
  geom_boxplot()

A.LLSC <- aov(abs.res.LLSC ~ SPP*QUARTILE, data=raw3)
summary(A.LLSC)
##               Df Sum Sq Mean Sq F value Pr(>F)  
## SPP            1   1.40  1.4013   2.940 0.0875 .
## QUARTILE       3   1.35  0.4506   0.945 0.4190  
## SPP:QUARTILE   3   3.42  1.1399   2.391 0.0688 .
## Residuals    292 139.19  0.4767                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A.SBLL <- aov(abs.res.SBLL ~ SPP*QUARTILE, data=raw3)
summary(A.SBLL)
##               Df Sum Sq Mean Sq F value Pr(>F)  
## SPP            1   0.65  0.6523   4.859 0.0283 *
## QUARTILE       3   0.78  0.2591   1.930 0.1248  
## SPP:QUARTILE   3   0.12  0.0390   0.291 0.8320  
## Residuals    292  39.20  0.1342                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.SBLL, fill=SPP)) +
  geom_boxplot()

A.BD <- aov(abs.res.BD ~ SPP*QUARTILE, data=raw3)
summary(A.BD)
##               Df Sum Sq   Mean Sq F value Pr(>F)  
## SPP            1 0.0000 0.0000346   0.026 0.8726  
## QUARTILE       3 0.0015 0.0004855   0.361 0.7811  
## SPP:QUARTILE   3 0.0087 0.0028846   2.146 0.0946 .
## Residuals    292 0.3925 0.0013442                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.BD, fill=SPP)) +
  geom_boxplot()

A.CPD <- aov(abs.res.CPD ~ SPP*QUARTILE, data=raw3)
summary(A.CPD)
##               Df  Sum Sq   Mean Sq F value  Pr(>F)   
## SPP            1 0.00312 0.0031247   4.900 0.02764 * 
## QUARTILE       3 0.00786 0.0026201   4.108 0.00707 **
## SPP:QUARTILE   3 0.00713 0.0023775   3.728 0.01176 * 
## Residuals    292 0.18622 0.0006377                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.CPD, fill=SPP)) +
  geom_boxplot()

A.CPL <- aov(abs.res.CPL ~ SPP*QUARTILE, data=raw3)
summary(A.CPL)
##               Df  Sum Sq  Mean Sq F value   Pr(>F)    
## SPP            1 0.00000 0.000000   0.000 0.986836    
## QUARTILE       3 0.01640 0.005468   6.588 0.000254 ***
## SPP:QUARTILE   3 0.02033 0.006777   8.166 3.08e-05 ***
## Residuals    292 0.24236 0.000830                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.CPL, fill=SPP)) +
  geom_boxplot()

A.PreDL <- aov(abs.res.PreDL ~ SPP*QUARTILE, data=raw3)
summary(A.PreDL)
##               Df  Sum Sq   Mean Sq F value Pr(>F)  
## SPP            1 0.00006 0.0000590   0.145 0.7035  
## QUARTILE       3 0.00243 0.0008091   1.991 0.1155  
## SPP:QUARTILE   3 0.00392 0.0013082   3.218 0.0232 *
## Residuals    292 0.11869 0.0004065                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.PreDL, fill=SPP)) +
  geom_boxplot()

A.DbL <- aov(abs.res.DbL ~ SPP*QUARTILE, data=raw3)
summary(A.DbL)
##               Df Sum Sq  Mean Sq F value Pr(>F)
## SPP            1 0.0001 0.000068   0.037  0.847
## QUARTILE       3 0.0060 0.001997   1.093  0.352
## SPP:QUARTILE   3 0.0068 0.002277   1.246  0.293
## Residuals    292 0.5335 0.001827
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.DbL, fill=SPP)) +
  geom_boxplot()

A.HL <- aov(abs.res.HL ~ SPP*QUARTILE, data=raw3)
summary(A.HL)
##               Df  Sum Sq  Mean Sq F value   Pr(>F)    
## SPP            1 0.00081 0.000812   0.861   0.3541    
## QUARTILE       3 0.02099 0.006995   7.421 8.33e-05 ***
## SPP:QUARTILE   3 0.01029 0.003432   3.640   0.0132 *  
## Residuals    292 0.27527 0.000943                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.HL, fill=SPP)) +
  geom_boxplot()

A.HD <- aov(abs.res.HD ~ SPP*QUARTILE, data=raw3)
summary(A.HD)
##               Df  Sum Sq   Mean Sq F value Pr(>F)
## SPP            1 0.00000 0.0000000   0.000  0.999
## QUARTILE       3 0.00443 0.0014757   1.522  0.209
## SPP:QUARTILE   3 0.00582 0.0019390   1.999  0.114
## Residuals    292 0.28319 0.0009698
A.HW <- aov(abs.res.HW ~ SPP*QUARTILE, data=raw3)
summary(A.HW)
##               Df  Sum Sq   Mean Sq F value  Pr(>F)   
## SPP            1 0.00213 0.0021307   2.861 0.09184 . 
## QUARTILE       3 0.00917 0.0030561   4.103 0.00712 **
## SPP:QUARTILE   3 0.00710 0.0023664   3.177 0.02448 * 
## Residuals    292 0.21750 0.0007449                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.HW, fill=SPP)) +
  geom_boxplot()

A.SnL <- aov(abs.res.SnL ~ SPP*QUARTILE, data=raw3)
summary(A.SnL)
##               Df  Sum Sq  Mean Sq F value   Pr(>F)    
## SPP            1 0.00009 0.000095   0.163   0.6867    
## QUARTILE       3 0.01743 0.005809   9.995 2.73e-06 ***
## SPP:QUARTILE   3 0.00494 0.001647   2.833   0.0386 *  
## Residuals    292 0.16972 0.000581                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A.OL <- aov(abs.res.OL ~ SPP*QUARTILE, data=raw3)
summary(A.OL)
##               Df    Sum Sq   Mean Sq F value Pr(>F)  
## SPP            1 4.900e-33 4.915e-33   2.108 0.1476  
## QUARTILE       3 1.830e-32 6.103e-33   2.617 0.0512 .
## SPP:QUARTILE   3 5.800e-33 1.948e-33   0.835 0.4754  
## Residuals    292 6.809e-31 2.332e-33                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(QUARTILE), y=abs.res.OL, fill=SPP)) +
  geom_boxplot()

Basins
A1.D <- aov(abs.res.D ~ SPP*BASIN, data=raw3)
summary(A1.D)
##              Df Sum Sq Mean Sq F value  Pr(>F)   
## SPP           1   0.06  0.0635   0.402 0.52666   
## BASIN         6   3.12  0.5205   3.293 0.00377 **
## SPP:BASIN     3   0.31  0.1028   0.650 0.58344   
## Residuals   289  45.68  0.1581                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.D, fill=SPP)) +
  geom_boxplot()

A1.P1 <- aov(abs.res.P1 ~ SPP*BASIN, data=raw3)
summary(A1.P1)
##              Df Sum Sq Mean Sq F value Pr(>F)
## SPP           1   0.29  0.2878   1.528  0.217
## BASIN         6   0.97  0.1613   0.856  0.528
## SPP:BASIN     3   0.53  0.1751   0.930  0.427
## Residuals   289  54.43  0.1883
A1.P1.R <- aov(abs.res.P1.R ~ SPP*BASIN, data=raw3)
summary(A1.P1.R)
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## SPP           1   1.80  1.7983  11.421 0.000826 ***
## BASIN         6   0.51  0.0845   0.537 0.780341    
## SPP:BASIN     3   0.15  0.0485   0.308 0.819718    
## Residuals   289  45.50  0.1575                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.P1.R, fill=SPP)) +
  geom_boxplot()

A1.LLSC <- aov(abs.res.LLSC ~ SPP*BASIN, data=raw3)
summary(A1.LLSC)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## SPP           1   1.40  1.4013   2.999 0.0844 .
## BASIN         6   6.83  1.1376   2.435 0.0260 *
## SPP:BASIN     3   2.11  0.7026   1.504 0.2137  
## Residuals   289 135.02  0.4672                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.LLSC, fill=SPP)) +
  geom_boxplot()

A1.SBLL <- aov(abs.res.SBLL ~ SPP*BASIN, data=raw3)
summary(A1.SBLL)
##              Df Sum Sq Mean Sq F value Pr(>F)  
## SPP           1   0.65  0.6523   4.895 0.0277 *
## BASIN         6   1.07  0.1785   1.340 0.2393  
## SPP:BASIN     3   0.51  0.1716   1.288 0.2788  
## Residuals   289  38.51  0.1332                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.SBLL, fill=SPP)) +
  geom_boxplot()

A1.BD <- aov(abs.res.BD ~ SPP*BASIN, data=raw3)
summary(A1.BD)
##              Df Sum Sq  Mean Sq F value Pr(>F)  
## SPP           1 0.0000 0.000035   0.027 0.8701  
## BASIN         6 0.0190 0.003167   2.450 0.0251 *
## SPP:BASIN     3 0.0101 0.003367   2.605 0.0520 .
## Residuals   289 0.3735 0.001292                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.BD, fill=SPP)) +
  geom_boxplot()

A1.CPD <- aov(abs.res.CPD ~ SPP*BASIN, data=raw3)
summary(A1.CPD)
##              Df  Sum Sq   Mean Sq F value   Pr(>F)    
## SPP           1 0.00312 0.0031247   4.984 0.026343 *  
## BASIN         6 0.01576 0.0026273   4.191 0.000464 ***
## SPP:BASIN     3 0.00428 0.0014261   2.275 0.080070 .  
## Residuals   289 0.18117 0.0006269                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.CPD, fill=SPP)) +
  geom_boxplot()

A1.CPL <- aov(abs.res.CPL ~ SPP*BASIN, data=raw3)
summary(A1.CPL)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## SPP           1 0.00000 0.000000   0.000    0.987    
## BASIN         6 0.03228 0.005380   6.320 2.92e-06 ***
## SPP:BASIN     3 0.00078 0.000259   0.304    0.822    
## Residuals   289 0.24603 0.000851                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A1.PreDL <- aov(abs.res.PreDL ~ SPP*BASIN, data=raw3)
summary(A1.PreDL)
##              Df  Sum Sq   Mean Sq F value Pr(>F)  
## SPP           1 0.00006 0.0000590   0.147 0.7020  
## BASIN         6 0.00466 0.0007773   1.932 0.0755 .
## SPP:BASIN     3 0.00412 0.0013741   3.416 0.0178 *
## Residuals   289 0.11626 0.0004023                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.PreDL, fill=SPP)) +
  geom_boxplot()

A1.DbL <- aov(abs.res.DbL ~ SPP*BASIN, data=raw3)
summary(A1.DbL)
##              Df Sum Sq  Mean Sq F value Pr(>F)
## SPP           1 0.0001 0.000068   0.037  0.847
## BASIN         6 0.0152 0.002539   1.397  0.216
## SPP:BASIN     3 0.0057 0.001914   1.053  0.370
## Residuals   289 0.5254 0.001818
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.DbL, fill=SPP)) +
  geom_boxplot()

A1.HL <- aov(abs.res.HL ~ SPP*BASIN, data=raw3)
summary(A1.HL)
##              Df  Sum Sq  Mean Sq F value  Pr(>F)   
## SPP           1 0.00081 0.000812   0.827 0.36379   
## BASIN         6 0.02039 0.003398   3.463 0.00255 **
## SPP:BASIN     3 0.00256 0.000852   0.868 0.45782   
## Residuals   289 0.28360 0.000981                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.HL, fill=SPP)) +
  geom_boxplot()

A1.HD <- aov(abs.res.HD ~ SPP*BASIN, data=raw3)
summary(A1.HD)
##              Df  Sum Sq   Mean Sq F value Pr(>F)
## SPP           1 0.00000 0.0000000   0.000  0.999
## BASIN         6 0.00478 0.0007959   0.808  0.565
## SPP:BASIN     3 0.00382 0.0012743   1.293  0.277
## Residuals   289 0.28484 0.0009856
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.HD, fill=SPP)) +
  geom_boxplot()

A1.HW <- aov(abs.res.HW ~ SPP*BASIN, data=raw3)
summary(A1.HW)
##              Df  Sum Sq   Mean Sq F value  Pr(>F)   
## SPP           1 0.00213 0.0021307   2.825 0.09387 . 
## BASIN         6 0.01505 0.0025085   3.326 0.00349 **
## SPP:BASIN     3 0.00076 0.0002544   0.337 0.79838   
## Residuals   289 0.21795 0.0007542                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.HW, fill=SPP)) +
  geom_boxplot()

A1.SnL <- aov(abs.res.SnL ~ SPP*BASIN, data=raw3)
summary(A1.SnL)
##              Df  Sum Sq  Mean Sq F value   Pr(>F)    
## SPP           1 0.00009 0.000095   0.162    0.688    
## BASIN         6 0.02054 0.003424   5.849 8.99e-06 ***
## SPP:BASIN     3 0.00238 0.000794   1.357    0.256    
## Residuals   289 0.16916 0.000585                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A1.OL <- aov(abs.res.OL ~ SPP*BASIN, data=raw3)
summary(A1.OL)
##              Df    Sum Sq   Mean Sq F value Pr(>F)
## SPP           1 4.900e-33 4.915e-33   2.054  0.153
## BASIN         6 9.200e-33 1.535e-33   0.641  0.697
## SPP:BASIN     3 4.100e-33 1.358e-33   0.567  0.637
## Residuals   289 6.917e-31 2.394e-33
ggplot(raw3, aes(x=factor(BASIN), y=abs.res.OL, fill=SPP)) +
  geom_boxplot()

Watersheds
A2.D <- aov(abs.res.D ~ SPP*WATERSHED, data=raw3)
summary(A2.D)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## SPP             1   0.06  0.0635   0.415 0.5198  
## WATERSHED      13   4.33  0.3331   2.178 0.0106 *
## SPP:WATERSHED   5   1.96  0.3922   2.564 0.0274 *
## Residuals     280  42.82  0.1529                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.D, fill=SPP)) +
  geom_boxplot()

A2.P1 <- aov(abs.res.P1 ~ SPP*WATERSHED, data=raw3)
summary(A2.P1)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## SPP             1   0.29  0.2878   1.568 0.2116  
## WATERSHED      13   3.73  0.2868   1.562 0.0957 .
## SPP:WATERSHED   5   0.78  0.1569   0.855 0.5120  
## Residuals     280  51.41  0.1836                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A2.P1.R <- aov(abs.res.P1.R ~ SPP*WATERSHED, data=raw3)
summary(A2.P1.R)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## SPP             1   1.80  1.7983  11.145 0.000957 ***
## WATERSHED      13   0.82  0.0629   0.390 0.972416    
## SPP:WATERSHED   5   0.16  0.0322   0.199 0.962521    
## Residuals     280  45.18  0.1614                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.P1.R, fill=SPP)) +
  geom_boxplot()

A2.LLSC <- aov(abs.res.LLSC ~ SPP*WATERSHED, data=raw3)
summary(A2.LLSC)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## SPP             1   1.40  1.4013   3.299   0.0704 .  
## WATERSHED      13  20.28  1.5596   3.672 2.15e-05 ***
## SPP:WATERSHED   5   4.75  0.9502   2.237   0.0509 .  
## Residuals     280 118.93  0.4248                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.LLSC, fill=SPP)) +
  geom_boxplot()

A2.SBLL <- aov(abs.res.SBLL ~ SPP*WATERSHED, data=raw3)
summary(A2.SBLL)
##                Df Sum Sq Mean Sq F value   Pr(>F)    
## SPP             1   0.65  0.6523   5.611   0.0185 *  
## WATERSHED      13   2.98  0.2289   1.969   0.0233 *  
## SPP:WATERSHED   5   4.57  0.9138   7.861 6.06e-07 ***
## Residuals     280  32.55  0.1162                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.SBLL, fill=SPP)) +
  geom_boxplot()

A2.BD <- aov(abs.res.BD ~ SPP*WATERSHED, data=raw3)
summary(A2.BD)
##                Df Sum Sq  Mean Sq F value  Pr(>F)   
## SPP             1 0.0000 0.000035   0.028 0.86766   
## WATERSHED      13 0.0427 0.003283   2.639 0.00171 **
## SPP:WATERSHED   5 0.0115 0.002309   1.856 0.10214   
## Residuals     280 0.3484 0.001244                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.BD, fill=SPP)) +
  geom_boxplot()

A2.CPD <- aov(abs.res.CPD ~ SPP*WATERSHED, data=raw3)
summary(A2.CPD)
##                Df  Sum Sq   Mean Sq F value Pr(>F)  
## SPP             1 0.00312 0.0031247   4.943 0.0270 *
## WATERSHED      13 0.01690 0.0012999   2.056 0.0169 *
## SPP:WATERSHED   5 0.00731 0.0014624   2.313 0.0441 *
## Residuals     280 0.17700 0.0006322                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.CPD, fill=SPP)) +
  geom_boxplot()

A2.CPL <- aov(abs.res.CPL ~ SPP*WATERSHED, data=raw3)
summary(A2.CPL)
##                Df  Sum Sq  Mean Sq F value   Pr(>F)    
## SPP             1 0.00000 0.000000   0.000   0.9866    
## WATERSHED      13 0.04566 0.003512   4.406 8.64e-07 ***
## SPP:WATERSHED   5 0.01021 0.002043   2.563   0.0275 *  
## Residuals     280 0.22322 0.000797                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A2.PreDL <- aov(abs.res.PreDL ~ SPP*WATERSHED, data=raw3)
summary(A2.PreDL)
##                Df  Sum Sq   Mean Sq F value Pr(>F)  
## SPP             1 0.00006 0.0000590   0.146 0.7022  
## WATERSHED      13 0.00996 0.0007664   1.902 0.0297 *
## SPP:WATERSHED   5 0.00229 0.0004575   1.136 0.3416  
## Residuals     280 0.11279 0.0004028                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A2.DbL <- aov(abs.res.DbL ~ SPP*WATERSHED, data=raw3)
summary(A2.DbL)
##                Df Sum Sq  Mean Sq F value   Pr(>F)    
## SPP             1 0.0001 0.000068   0.040 0.841516    
## WATERSHED      13 0.0348 0.002680   1.579 0.090441 .  
## SPP:WATERSHED   5 0.0363 0.007253   4.273 0.000923 ***
## Residuals     280 0.4752 0.001697                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.DbL, fill=SPP)) +
  geom_boxplot()

A2.HL <- aov(abs.res.HL ~ SPP*WATERSHED, data=raw3)
summary(A2.HL)
##                Df  Sum Sq  Mean Sq F value   Pr(>F)    
## SPP             1 0.00081 0.000812   0.896    0.345    
## WATERSHED      13 0.05036 0.003874   4.275 1.54e-06 ***
## SPP:WATERSHED   5 0.00247 0.000494   0.546    0.742    
## Residuals     280 0.25372 0.000906                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.HL, fill=SPP)) +
  geom_boxplot()

A2.HD <- aov(abs.res.HD ~ SPP*WATERSHED, data=raw3)
summary(A2.HD)
##                Df  Sum Sq   Mean Sq F value Pr(>F)
## SPP             1 0.00000 0.0000000   0.000  0.999
## WATERSHED      13 0.01725 0.0013271   1.371  0.173
## SPP:WATERSHED   5 0.00519 0.0010375   1.072  0.376
## Residuals     280 0.27100 0.0009678
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.HD, fill=SPP)) +
  geom_boxplot()

A2.HW <- aov(abs.res.HW ~ SPP*WATERSHED, data=raw3)
summary(A2.HW)
##                Df  Sum Sq   Mean Sq F value Pr(>F)  
## SPP             1 0.00213 0.0021307   2.862 0.0918 .
## WATERSHED      13 0.02008 0.0015446   2.075 0.0157 *
## SPP:WATERSHED   5 0.00521 0.0010418   1.399 0.2246  
## Residuals     280 0.20848 0.0007446                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.HW, fill=SPP)) +
  geom_boxplot()

A2.SnL <- aov(abs.res.SnL ~ SPP*WATERSHED, data=raw3)
summary(A2.SnL)
##                Df  Sum Sq   Mean Sq F value   Pr(>F)    
## SPP             1 0.00009 0.0000948   0.180    0.672    
## WATERSHED      13 0.04027 0.0030976   5.890 1.23e-09 ***
## SPP:WATERSHED   5 0.00457 0.0009144   1.739    0.126    
## Residuals     280 0.14725 0.0005259                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A2.OL <- aov(abs.res.OL ~ SPP*WATERSHED, data=raw3)
summary(A2.OL)
##                Df    Sum Sq   Mean Sq F value Pr(>F)
## SPP             1 4.900e-33 4.915e-33   2.037  0.155
## WATERSHED      13 2.900e-32 2.231e-33   0.925  0.528
## SPP:WATERSHED   5 2.000e-34 4.600e-35   0.019  1.000
## Residuals     280 6.758e-31 2.414e-33
ggplot(raw3, aes(x=factor(WATERSHED), y=abs.res.OL, fill=SPP)) +
  geom_boxplot()

Standardized

DON’T KNOW IF THIS IS USEFUL

The ANOVAs above focus on differences of particular traits as a factor of species and location. If we want to get an idea of variation in general as a factor of species and location, we can standardize the residuals (essentially unitless z-scores of residuals).

sd.res.D <- append(abs(sd.lat.D), abs(sd.form.D))
sd.res.P1 <- append(abs(sd.lat.P1), abs(sd.form.P1))
sd.res.P1.R <- append(abs(sd.lat.P1.R), abs(sd.form.P1.R))
sd.res.LLSC<- append(abs(sd.lat.LLSC), abs(sd.form.LLSC))
sd.res.SBLL<- append(abs(sd.lat.SBLL), abs(sd.form.SBLL))
sd.res.BD<- append(abs(sd.lat.BD), abs(sd.form.BD))
sd.res.CPD<- append(abs(sd.lat.CPD), abs(sd.form.CPD))
sd.res.CPL<- append(abs(sd.lat.CPL), abs(sd.form.CPL))
sd.res.PreDL <- append(abs(sd.lat.PreDL), abs(sd.form.PreDL))
sd.res.DbL <- append(abs(sd.lat.DbL), abs(sd.form.DbL))
sd.res.HL<- append(abs(sd.lat.HL), abs(sd.form.HL))
sd.res.HD<- append(abs(sd.lat.HD), abs(sd.form.HD))
sd.res.HW <- append(abs(sd.lat.HW), abs(sd.form.HW))
sd.res.SnL <- append(abs(sd.lat.SnL), abs(sd.form.SnL))
sd.res.OL <- append(abs(sd.lat.OL), abs(sd.form.OL))


raw4 <- cbind(raw3, sd.res.D, sd.res.P1, sd.res.P1.R, sd.res.LLSC, sd.res.SBLL, sd.res.BD, sd.res.CPD, sd.res.CPL, sd.res.PreDL, sd.res.DbL, sd.res.HL, sd.res.HD, sd.res.HW, sd.res.SnL, sd.res.OL)

raw5 <- cbind(raw4[1:14], stack(raw4[53:68])) 
## Warning in data.frame(..., check.names = FALSE): row names were found from a
## short variable and have been discarded
lat.raw5 <- raw5[raw5$SPP == "p.latipinna",]

form.raw5 <- raw5[raw5$SPP == "p.formosa",]

######ZONES#####

A3.lat <- aov(values~QUARTILE, data=lat.raw5)
summary(A3.lat)
##               Df Sum Sq Mean Sq F value Pr(>F)
## QUARTILE       3    0.6  0.2106    1.13  0.336
## Residuals   2140  398.9  0.1864
A3.form <- aov(values~QUARTILE, data=form.raw5)
summary(A3.form)
##               Df Sum Sq Mean Sq F value Pr(>F)  
## QUARTILE       3    1.9  0.6213   2.851 0.0361 *
## Residuals   2652  578.0  0.2180                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#between species

A3 <- aov(values~QUARTILE*SPP, data=raw5)
summary(A3)
##                Df Sum Sq Mean Sq F value Pr(>F)  
## QUARTILE        3    0.8  0.2626   1.288  0.277  
## SPP             1    0.1  0.0604   0.296  0.586  
## QUARTILE:SPP    3    1.7  0.5578   2.736  0.042 *
## Residuals    4792  976.9  0.2039                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw5, aes(x=factor(QUARTILE), y=values, fill=SPP)) +
  geom_boxplot()

######BASINS#####

A4.lat <- aov(values~BASIN, data=lat.raw5)
summary(A4.lat)
##               Df Sum Sq Mean Sq F value Pr(>F)
## BASIN          5    0.8  0.1597   0.856   0.51
## Residuals   2138  398.7  0.1865
A4.form <- aov(values~BASIN, data=form.raw5)
summary(A4.form)
##               Df Sum Sq Mean Sq F value Pr(>F)
## BASIN          4    0.6  0.1525   0.698  0.593
## Residuals   2651  579.3  0.2185
#between species

A4 <- aov(values~BASIN*SPP, data=raw5)
summary(A4)
##               Df Sum Sq Mean Sq F value Pr(>F)
## BASIN          6    0.6 0.09760   0.478  0.825
## SPP            1    0.0 0.03245   0.159  0.690
## BASIN:SPP      3    0.8 0.27201   1.332  0.262
## Residuals   4789  978.0 0.20422
ggplot(raw5, aes(x=factor(BASIN), y=values, fill=SPP)) +
  geom_boxplot()

#####WATERSHEDS#####
A5.lat <- aov(values~WATERSHED, data=lat.raw5)
summary(A5.lat)
##               Df Sum Sq Mean Sq F value Pr(>F)
## WATERSHED     11    2.7  0.2441   1.312  0.211
## Residuals   2132  396.8  0.1861
A5.form <- aov(values~WATERSHED, data=form.raw5)
summary(A5.form)
##               Df Sum Sq Mean Sq F value   Pr(>F)    
## WATERSHED      7    5.9  0.8383   3.867 0.000339 ***
## Residuals   2648  574.0  0.2168                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#between species

A5 <- aov(values~WATERSHED*SPP, data=raw5)
summary(A5)
##                 Df Sum Sq Mean Sq F value  Pr(>F)   
## WATERSHED       13    5.9  0.4574   2.252 0.00609 **
## SPP              1    0.2  0.1715   0.844 0.35818   
## WATERSHED:SPP    5    2.5  0.4924   2.424 0.03332 * 
## Residuals     4780  970.8  0.2031                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ggplot(raw5, aes(x=factor(WATERSHED), y=values, fill=SPP)) +
  geom_boxplot()

GLMMs

Will run mixed models with zones/basins/watersheds as random effect. This will account for any variation seen at these levels and show us if there are any consistent species differences. Can only do this with residuals.

Zones

library(lme4)
## Loading required package: Matrix
library(lmerTest)
## 
## Attaching package: 'lmerTest'
## The following object is masked from 'package:lme4':
## 
##     lmer
## The following object is masked from 'package:stats':
## 
##     step
MM.D <- glmer(abs.res.D ~ SPP + (1|QUARTILE), data=raw3)#originally had family=poisson, since this is count data, but because this was the residuals of count data, the values were non-integers and poisson only deals with integers. 
## Warning in glmer(abs.res.D ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM.D)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.D ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: 318.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.3483 -0.9655 -0.2478  0.7809  3.9563 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  QUARTILE (Intercept) 0.0000   0.000   
##  Residual             0.1648   0.406   
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.56682    0.03151  17.989
## SPPp.latipinna -0.02927    0.04715  -0.621
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.668
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM.P1 <- glmer(abs.res.P1 ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.P1 ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.P1)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.P1 ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: 355.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.2125 -0.7823 -0.2409  0.6284  6.7042 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  QUARTILE (Intercept) 0.002772 0.05265 
##  Residual             0.185601 0.43081 
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.46859    0.04477  10.468
## SPPp.latipinna  0.07076    0.05059   1.399
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.539
MM.P1.R <- glmer(abs.res.P1.R ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.P1.R ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM.P1.R)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.P1.R ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: 299.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.4497 -0.7453 -0.4259  0.4658  4.2022 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  QUARTILE (Intercept) 0.0000   0.0000  
##  Residual             0.1549   0.3936  
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.42420    0.03055  13.887
## SPPp.latipinna  0.15574    0.04571   3.407
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.668
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM.LLSC <- glmer(abs.res.LLSC ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.LLSC ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM.LLSC)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.LLSC ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: 638.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.2981 -0.6895 -0.3493  0.6058  5.1291 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  QUARTILE (Intercept) 0.0000   0.000   
##  Residual             0.4831   0.695   
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.90388    0.05395  16.755
## SPPp.latipinna -0.13748    0.08072  -1.703
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.668
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM.SBLL <- glmer(abs.res.SBLL ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.SBLL ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.SBLL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.SBLL ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: 256.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -0.9763 -0.5477 -0.4390 -0.1701  4.4673 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  QUARTILE (Intercept) 0.001931 0.04395 
##  Residual             0.133213 0.36498 
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.32895    0.03771   8.723
## SPPp.latipinna -0.08923    0.04285  -2.082
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.542
MM.BD <- glmer(abs.res.BD ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.BD ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM.BD)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.BD ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1113.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.2937 -0.7874 -0.2157  0.5092  3.9398 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  QUARTILE (Intercept) 0.000000 0.00000 
##  Residual             0.001351 0.03676 
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)    0.0471000  0.0028529   16.51
## SPPp.latipinna 0.0006832  0.0042686    0.16
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.668
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM.CPD <- glmer(abs.res.CPD ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.CPD ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.CPD)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.CPD ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1324.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.6019 -0.6976 -0.2772  0.5266  3.6832 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.
##  QUARTILE (Intercept) 3.077e-05 0.005547
##  Residual             6.554e-04 0.025600
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)    0.033357   0.003554   9.386
## SPPp.latipinna 0.004898   0.003022   1.621
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.417
MM.CPL <- glmer(abs.res.CPL ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.CPL ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.CPL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.CPL ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1232.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.5869 -0.7228 -0.2561  0.4544  4.9638 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.
##  QUARTILE (Intercept) 0.0000675 0.008216
##  Residual             0.0008903 0.029838
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)     0.042114   0.004869   8.650
## SPPp.latipinna -0.002587   0.003527  -0.734
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.358
MM.PreDL <- glmer(abs.res.PreDL ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.PreDL ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.PreDL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.PreDL ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1462.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.3986 -0.7883 -0.1772  0.5298  3.8393 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.
##  QUARTILE (Intercept) 6.372e-06 0.002524
##  Residual             4.160e-04 0.020396
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)    0.026586   0.002130  12.482
## SPPp.latipinna 0.000617   0.002395   0.258
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.537
MM.DbL <- glmer(abs.res.DbL ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.DbL ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.DbL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.DbL ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1022.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.2054 -0.7237 -0.1983  0.5176  5.7638 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.
##  QUARTILE (Intercept) 3.147e-06 0.001774
##  Residual             1.831e-03 0.042794
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)    0.0510345  0.0035002  14.580
## SPPp.latipinna 0.0007607  0.0049822   0.153
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.646
MM.HL <- glmer(abs.res.HL ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.HL ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.HL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.HL ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1206
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.7939 -0.7208 -0.1760  0.4510  4.9490 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.
##  QUARTILE (Intercept) 0.0001226 0.01107 
##  Residual             0.0009683 0.03112 
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)     0.041696   0.006179   6.748
## SPPp.latipinna -0.005130   0.003683  -1.393
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.296
MM.HD <- glmer(abs.res.HD ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.HD ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.HD)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.HD ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1207.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.1443 -0.7319 -0.2454  0.4451  7.3258 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.
##  QUARTILE (Intercept) 6.794e-06 0.002606
##  Residual             9.806e-04 0.031314
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                  Estimate Std. Error t value
## (Intercept)     0.0352739  0.0028771  12.260
## SPPp.latipinna -0.0001526  0.0036632  -0.042
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.594
MM.HW <- glmer(abs.res.HW ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.HW ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.HW)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.HW ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1279.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.4651 -0.7690 -0.2162  0.5507  3.8682 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.
##  QUARTILE (Intercept) 4.521e-05 0.006724
##  Residual             7.618e-04 0.027601
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)     0.037901   0.004135   9.166
## SPPp.latipinna -0.005911   0.003260  -1.813
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.388
MM.SnL <- glmer(abs.res.SnL ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.SnL ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.SnL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.SnL ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -1351.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.7461 -0.7239 -0.2006  0.5339  5.7707 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev.
##  QUARTILE (Intercept) 0.0001039 0.01019 
##  Residual             0.0005922 0.02433 
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)     0.035273   0.005533   6.375
## SPPp.latipinna -0.002665   0.002882  -0.925
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.260
MM.OL <- glmer(abs.res.OL ~ SPP+ (1|QUARTILE), data=raw3)
## Warning in glmer(abs.res.OL ~ SPP + (1 | QUARTILE), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM.OL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.OL ~ SPP + (1 | QUARTILE)
##    Data: raw3
## 
## REML criterion at convergence: -21533.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -0.4760 -0.1561 -0.0480 -0.0041 16.1580 
## 
## Random effects:
##  Groups   Name        Variance  Std.Dev. 
##  QUARTILE (Intercept) 5.722e-35 7.564e-18
##  Residual             2.327e-33 4.824e-17
## Number of obs: 300, groups:  QUARTILE, 4
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)    6.867e-18  5.591e-18   1.228
## SPPp.latipinna 7.835e-18  5.678e-18   1.380
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.491

Watershed nested in Basin

MM1.D <- glmer(abs.res.D ~ SPP + (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.D ~ SPP + (1 | BASIN/WATERSHED), data = raw3): calling
## glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM1.D)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.D ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: 311.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.6107 -0.7821 -0.1826  0.7087  3.7632 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 0.0003511 0.01874 
##  BASIN           (Intercept) 0.0110904 0.10531 
##  Residual                    0.1573563 0.39668 
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.53497    0.05752    9.30
## SPPp.latipinna -0.01618    0.04757   -0.34
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.429
MM1.P1 <- glmer(abs.res.P1 ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.P1 ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM1.P1)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.P1 ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: 353.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.3207 -0.7471 -0.2578  0.6288  6.7142 
## 
## Random effects:
##  Groups          Name        Variance Std.Dev.
##  WATERSHED:BASIN (Intercept) 0.007268 0.08525 
##  BASIN           (Intercept) 0.000000 0.00000 
##  Residual                    0.181635 0.42619 
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.47671    0.04511  10.568
## SPPp.latipinna  0.06213    0.05321   1.168
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.558
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM1.P1.R <- glmer(abs.res.P1.R ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.P1.R ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM1.P1.R)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.P1.R ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: 299.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.4497 -0.7453 -0.4259  0.4658  4.2022 
## 
## Random effects:
##  Groups          Name        Variance Std.Dev.
##  WATERSHED:BASIN (Intercept) 0.0000   0.0000  
##  BASIN           (Intercept) 0.0000   0.0000  
##  Residual                    0.1549   0.3936  
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.42420    0.03055  13.887
## SPPp.latipinna  0.15574    0.04571   3.407
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.668
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM1.LLSC <- glmer(abs.res.LLSC ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.LLSC ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM1.LLSC)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.LLSC ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: 620
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.0522 -0.6986 -0.2459  0.5793  4.4872 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev. 
##  WATERSHED:BASIN (Intercept) 6.596e-02 2.568e-01
##  BASIN           (Intercept) 1.668e-09 4.084e-05
##  Residual                    4.313e-01 6.567e-01
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.94523    0.09693   9.752
## SPPp.latipinna -0.12349    0.08732  -1.414
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.452
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM1.SBLL <- glmer(abs.res.SBLL ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.SBLL ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM1.SBLL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.SBLL ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: 254.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.1262 -0.5674 -0.3973 -0.1771  4.2669 
## 
## Random effects:
##  Groups          Name        Variance Std.Dev.
##  WATERSHED:BASIN (Intercept) 0.005858 0.07654 
##  BASIN           (Intercept) 0.000000 0.00000 
##  Residual                    0.130078 0.36066 
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)     0.34254    0.03908   8.764
## SPPp.latipinna -0.07826    0.04527  -1.729
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.551
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM1.BD <- glmer(abs.res.BD ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.BD ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM1.BD)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.BD ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1123.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.6874 -0.7741 -0.1457  0.5355  3.8809 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 1.000e-04 0.010002
##  BASIN           (Intercept) 2.419e-05 0.004918
##  Residual                    1.256e-03 0.035442
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)    0.045107   0.004946   9.119
## SPPp.latipinna 0.003903   0.004595   0.849
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.467
MM1.CPD <- glmer(abs.res.CPD ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.CPD ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM1.CPD)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.CPD ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1327.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.7287 -0.7186 -0.2745  0.5424  3.5807 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 0.000e+00 0.000000
##  BASIN           (Intercept) 8.916e-05 0.009443
##  Residual                    6.388e-04 0.025274
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)    0.033462   0.004517   7.408
## SPPp.latipinna 0.005003   0.003039   1.646
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.359
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM1.CPL <- glmer(abs.res.CPL ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.CPL ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM1.CPL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.CPL ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1245.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.7535 -0.6801 -0.2268  0.4777  5.0999 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 5.811e-05 0.007623
##  BASIN           (Intercept) 1.526e-04 0.012353
##  Residual                    8.204e-04 0.028642
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)     0.038643   0.006151   6.282
## SPPp.latipinna -0.002021   0.003769  -0.536
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.326
MM1.PreDL <- glmer(abs.res.PreDL ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.PreDL ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM1.PreDL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.PreDL ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1463.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.4140 -0.7964 -0.2149  0.5949  3.7976 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 2.010e-05 0.004483
##  BASIN           (Intercept) 7.150e-06 0.002674
##  Residual                    4.043e-04 0.020108
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)    0.025649   0.002570   9.980
## SPPp.latipinna 0.002561   0.002552   1.003
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.492
MM1.DbL <- glmer(abs.res.DbL ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.DbL ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM1.DbL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.DbL ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1025.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.4234 -0.7319 -0.1995  0.5300  5.5681 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 6.296e-05 0.007935
##  BASIN           (Intercept) 0.000e+00 0.000000
##  Residual                    1.779e-03 0.042181
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)    0.052591   0.004362  12.057
## SPPp.latipinna 0.002230   0.005238   0.426
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.566
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM1.HL <- glmer(abs.res.HL ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.HL ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM1.HL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.HL ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1214.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.9869 -0.6862 -0.2460  0.4573  5.3177 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev. 
##  WATERSHED:BASIN (Intercept) 2.434e-04 1.560e-02
##  BASIN           (Intercept) 6.874e-13 8.291e-07
##  Residual                    8.994e-04 2.999e-02
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                  Estimate Std. Error t value
## (Intercept)     0.0409257  0.0053166   7.698
## SPPp.latipinna -0.0008278  0.0040825  -0.203
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.396
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM1.HD <- glmer(abs.res.HD ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.HD ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
## boundary (singular) fit: see help('isSingular')
summary(MM1.HD)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.HD ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1208.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.3046 -0.6977 -0.2280  0.4486  7.3347 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 2.674e-05 0.005171
##  BASIN           (Intercept) 0.000e+00 0.000000
##  Residual                    9.646e-04 0.031058
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)    0.0359928  0.0030772  11.696
## SPPp.latipinna 0.0003754  0.0038188   0.098
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.580
## optimizer (nloptwrap) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
MM1.HW <- glmer(abs.res.HW ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.HW ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM1.HW)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.HW ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1278.1
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.4833 -0.7386 -0.2504  0.6205  3.8136 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 1.243e-05 0.003525
##  BASIN           (Intercept) 1.139e-04 0.010674
##  Residual                    7.483e-04 0.027354
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)     0.042774   0.005171   8.272
## SPPp.latipinna -0.008136   0.003414  -2.383
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.351
MM1.SnL <- glmer(abs.res.SnL ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.SnL ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM1.SnL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.SnL ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -1366.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.7820 -0.7010 -0.2279  0.5326  5.6120 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev.
##  WATERSHED:BASIN (Intercept) 0.0001494 0.01222 
##  BASIN           (Intercept) 0.0001156 0.01075 
##  Residual                    0.0005318 0.02306 
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                Estimate Std. Error t value
## (Intercept)    0.035699   0.006034   5.916
## SPPp.latipinna 0.002444   0.003182   0.768
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.284
MM1.OL <- glmer(abs.res.OL ~ SPP+ (1|BASIN/WATERSHED), data=raw3)
## Warning in glmer(abs.res.OL ~ SPP + (1 | BASIN/WATERSHED), data = raw3):
## calling glmer() with family=gaussian (identity link) as a shortcut to lmer() is
## deprecated; please call lmer() directly
summary(MM1.OL)
## Linear mixed model fit by REML ['lmerMod']
## Formula: abs.res.OL ~ SPP + (1 | BASIN/WATERSHED)
##    Data: raw3
## 
## REML criterion at convergence: -21531.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -0.4183 -0.1394 -0.0756 -0.0187 16.1619 
## 
## Random effects:
##  Groups          Name        Variance  Std.Dev. 
##  WATERSHED:BASIN (Intercept) 2.299e-35 4.795e-18
##  BASIN           (Intercept) 6.839e-36 2.615e-18
##  Residual                    2.342e-33 4.839e-17
## Number of obs: 300, groups:  WATERSHED:BASIN, 14; BASIN, 7
## 
## Fixed effects:
##                 Estimate Std. Error t value
## (Intercept)    6.473e-18  4.433e-18   1.460
## SPPp.latipinna 7.354e-18  5.778e-18   1.273
## 
## Correlation of Fixed Effects:
##             (Intr)
## SPPp.latpnn -0.603

Levene’s w/ Basin?

Not sure if this is correct, but might try Levene’s test with zone/basin/watershed as an additional independent factor? This is for the traits that did NOT vary with body length.

Zones

library(car)
## Loading required package: carData
(LT2_P2L <- leveneTest(P2.L~SPP*QUARTILE, data=raw3)) #gives nothing since it's all the same value
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group   7     NaN    NaN
##       292
(LT2_P2R <- leveneTest(P2.R~SPP*QUARTILE, data=raw3)) #same as above
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group   7     NaN    NaN
##       292
(LT2_A <- leveneTest(A~SPP*QUARTILE, data=raw3)) 
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group   7  1.0512 0.3954
##       292
(LT2_SALL <- leveneTest(SALL~SPP*QUARTILE, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value    Pr(>F)    
## group   7  5.5952 4.562e-06 ***
##       292                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_SBLL <- leveneTest(SBLL~SPP*QUARTILE, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group   7  1.1533 0.3299
##       292
(LT2_SBDF <- leveneTest(SBDF~SPP*QUARTILE, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value  Pr(>F)  
## group   7  2.0714 0.04655 *
##       292                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_FLA <- leveneTest(FLA~SPP*QUARTILE, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value   Pr(>F)   
## group   7  3.5457 0.001129 **
##       292                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Basins

(LT2_P2L <- leveneTest(P2.L~SPP*BASIN, data=raw3)) #gives nothing since it's all the same value
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group  10     NaN    NaN
##       289
(LT2_P2R <- leveneTest(P2.R~SPP*BASIN, data=raw3)) #same as above
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group  10     NaN    NaN
##       289
(LT2_A <- leveneTest(A~SPP*BASIN, data=raw3)) 
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value   Pr(>F)   
## group  10  2.7914 0.002593 **
##       289                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_SALL <- leveneTest(SALL~SPP*BASIN, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value    Pr(>F)    
## group  10  5.9307 3.629e-08 ***
##       289                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_SBLL <- leveneTest(SBLL~SPP*BASIN, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group  10   1.467 0.1511
##       289
(LT2_SBDF <- leveneTest(SBDF~SPP*BASIN, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value    Pr(>F)    
## group  10  3.3639 0.0003629 ***
##       289                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_FLA <- leveneTest(FLA~SPP*BASIN, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group  10  1.4055  0.177
##       289

Watersheds

(LT2_P2L <- leveneTest(P2.L~SPP*WATERSHED, data=raw3)) #gives nothing since it's all the same value
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group  19     NaN    NaN
##       280
(LT2_P2R <- leveneTest(P2.R~SPP*WATERSHED, data=raw3)) #same as above
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value Pr(>F)
## group  19     NaN    NaN
##       280
(LT2_A <- leveneTest(A~SPP*WATERSHED, data=raw3)) 
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value  Pr(>F)  
## group  19  1.4755 0.09315 .
##       280                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_SALL <- leveneTest(SALL~SPP*WATERSHED, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value    Pr(>F)    
## group  19  2.6048 0.0003655 ***
##       280                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_SBLL <- leveneTest(SBLL~SPP*WATERSHED, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value   Pr(>F)   
## group  19  2.0999 0.005256 **
##       280                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_SBDF <- leveneTest(SBDF~SPP*WATERSHED, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value   Pr(>F)   
## group  19  2.0915 0.005484 **
##       280                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(LT2_FLA <- leveneTest(FLA~SPP*WATERSHED, data=raw3))
## Levene's Test for Homogeneity of Variance (center = median)
##        Df F value  Pr(>F)  
## group  19  1.8711 0.01617 *
##       280                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

ICCs

I’m hoping I can do this, but thought another interesting way of testing this would be to calculate and intraclass correlation coefficient–so looking at between-group variance compared to total variance, to see if variation is driven more from within or between group (if there is any at all…). I know lots of examples specify repeated measures, but I think the function below lets me specify that I only have one measurement per subject. I’m going to do this with raw data below, but will also repeat it with PCA scores in the PCA section, so that things are standardized for length. Since I’m interested in variation across populations, I think I would perform this within each sex; I am not sure how I would test this between sexes AND populations for each trait. Maybe I could then compare the ICC scores?

library(psych)

#ICC_result_twoway_explicit <- ICC(data = data\(value, id = data\)composite_id, grouping = data$population, model = “twoway”, type = “agreement”, unit = “single”, r0 = 1)

(ICC_L.D <- ICC(lat3))